function tests = test_global_ex14_2_3
tests = functiontests(localfunctions);

function test1(testCase)
% Model generated from ex14_2_3.gms
% Created 02-Aug-2007 10:35:21 using YALMIP R20070725

% Setup a clean YALMIP environment 
yalmip('clear') 

% Define all variables 
x1 = sdpvar(1);
x2 = sdpvar(1);
x3 = sdpvar(1);
x4 = sdpvar(1);
x5 = sdpvar(1);
x7 = sdpvar(1);

% Define objective function 
objective = -(0-x7-0);

% Define constraints 
F = ([]);
F=[F,log(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+1.55190688128384*x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+0.767395887387844*x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.989870205661735*x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4)+2787.49800065313/(229.664+x5)-x7<=10.7545020354713];
F=[F,log(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+1.2689544013438*x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+0.176307940228365*x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.928335072476283*x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4)+2696.24885600287/(226.232+x5)-x7<=10.3803549837107];
F=[F,log(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.696334182309743*x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+0.696676834276998*x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.308103094315467*x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4)+3643.31361767678/(239.726+x5)-x7<=12.9738026256517];
F=[F,log(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4)+0.590071729272002*x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+1.27289874839144*x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+0.187999658986436*x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4)+2755.64173589155/(219.161+x5)-x7<=10.2081676704566];
F=[F,(-log(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4))-(x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+1.55190688128384*x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+0.767395887387844*x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.989870205661735*x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4))-2787.49800065313/(229.664+x5)-x7<=-10.7545020354713];
F=[F,(-log(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4))-(1.2689544013438*x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+0.176307940228365*x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.928335072476283*x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4))-2696.24885600287/(226.232+x5)-x7<=-10.3803549837107];
F=[F,(-log(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4))-(0.696334182309743*x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+0.696676834276998*x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+0.308103094315467*x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4))-3643.31361767678/(239.726+x5)-x7<=-12.9738026256517];
F=[F,(-log(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4))-(0.590071729272002*x1/(x1+1.2689544013438*x2+0.696334182309743*x3+0.590071729272002*x4)+1.27289874839144*x2/(1.55190688128384*x1+x2+0.696676834276998*x3+1.27289874839144*x4)+0.187999658986436*x3/(0.767395887387844*x1+0.176307940228365*x2+x3+0.187999658986436*x4)+x4/(0.989870205661735*x1+0.928335072476283*x2+0.308103094315467*x3+x4))-2755.64173589155/(219.161+x5)-x7<=-10.2081676704566];
F=[F,x1+x2+x3+x4==1];
F=[F,1e-006<=x1<=1];
F=[F,1e-006<=x2<=1];
F=[F,1e-006<=x3<=1];
F=[F,1e-006<=x4<=1];
F=[F,20<=x5<=80];
F=[F,0<=x7];

% Solve problem
sol = optimize(F,objective,sdpsettings('bmibnb.uppersolver','fmincon','solver','bmibnb'));
testCase.assertTrue(sol.problem==0)
testCase.assertTrue(abs(value(objective)-0) <= 1e-2)